package com.yunxin.download.server.infra.support.file.export.context;



import cn.afterturn.easypoi.word.entity.MyXWPFDocument;
import com.yunxin.download.server.infra.support.file.FileHeader;

import java.io.InputStream;

/**
 * @author zero°
 * @since 2023-06-15
 */
public class FileExportContextFactory {

    private FileExportContextFactory() {
    }

    /**
     * 通过inputSteam获取导出模板
     * @param fileName fileName
     * @param templateInputStream templateInputStream
     *
     * @return ExcelExportContext
     */
    public static FileExportContext newInputSteamTemplateContext(String fileName, InputStream templateInputStream) {
        return new NormalFileExportContext(fileName, templateInputStream);
    }


    /**
     * 通过dtoClass获取导出模板
     * @param fileName fileName
     * @param templateDtoClass templateDtoClass
     *
     * @return ExcelExportContext
     */
    public static FileExportContext newDtoTemplateContext(String fileName, Class<? extends FileHeader> templateDtoClass) {
        return new NormalFileExportContext(fileName, templateDtoClass);
    }

}
